<!-- 2.组件通信->子传父-->
<script setup lang="ts">;
import { ref } from 'vue';
// 导入组件
import SomCom from './components/SomCom.vue';
const text = ref('我是父组件的数据');
const money = ref(10);

const changes = (myMoney: number) => {
  console.log('我被触发了');
  console.log(money);
  money.value = myMoney;


}
</script>

<template>
  <h2>我是父组件</h2>
  <SomCom :text="text" :money="money"></SomCom>
  <!-- 父组件接收子组件传递过来的回调函数 -->
  <SomCom @change-money="changes" :money="money"></SomCom>

</template>
<style scoped></style>
